package edu.serg.mbar.ucon.meta;

import java.util.Iterator;

import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;

import org.apache.xml.utils.PrefixResolver;
import org.w3c.dom.Node;

public class MBARNamespaceContext implements NamespaceContext {
	public String getNamespaceURI(String prefix) {
		if (prefix.equals("sub"))
			return "http://serg.imsciences.edu.pk/mbar/Subject";
		else if (prefix.equals("sub1"))
			return "http://serg.imsciences.edu.pk/mbar/Subject";
		else if (prefix.equals("obj"))
			return "http://serg.imsciences.edu.pk/mbar/Object";
//		else if (prefix.equals("pol"))
//			return "http://serg.imsciences.edu.pk/mbar/UCONPolicy";
		else if (prefix.equals("p"))
			return "http://serg.imsciences.edu.pk/mbar/UCONPolicy";
		else
			return XMLConstants.NULL_NS_URI;
	}

	public String getPrefix(String namespace) {
		if (namespace.equals("http://serg.imsciences.edu.pk/mbar/Subject"))
			return "sub";
		else if (namespace.equals("http://serg.imsciences.edu.pk/mbar/Object"))
			return "obj";
		else if (namespace.equals("http://serg.imsciences.edu.pk/mbar/UCONPolicy"))
			return "p";
		else
			return null;
	}

	public Iterator getPrefixes(String namespace) {
		return null;
	}

}
